-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add eslint to project and format files in project #244
base: master
Are you sure you want to change the base?
Conversation
}, | ||
rules: { | ||
indent: ["error", 2], | ||
"linebreak-style": ["error", "unix"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are enforcing a linebreak style then a .gitattributes
file is also needed for Window's users where git's setting for line-endings is going to default to CRLF
on checkout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer removing the linebreak style check in lint or adding a gitattributes file ? Seems like most of the code base has CRLF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need both. Git doesn't really have anything to do with linting but the opposite is not true. Linting will give errors if you checkout this repo on windows without a .gitattributes file and the eslint rc line-endings are set to LF.
But the files are actually LF. If you run git ls-files --eol
then you will see that the index (the first column of output) shows all to be LF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is to break as little as possible.
If we swap to unix linting then you must add a .gitattributes file for windows users so they checkout as LF. This would require users to reclone their repos.
That file would look like this:
* text=auto eol=lf
Or keep rules without linebreak-style but make sure they are converted to LF when added to the index
* text=auto
I think the least intrusive option is the 2nd as it doesn't require everyone to reclone. Unless there is a way to get the line-endings fixed without cloning.
definitely agree on text=auto. Should we scrap this PR or someone wants to update it? |
No description provided.